#include<bits/stdc++.h>
#define int long long
using namespace std;
#define double long double
double eps = 1e-9;
inline int sq(int x)
{
	int l = 0,r = 1e9+5,res = 0;
	while(l<=r)
	{
		int mid = (l+r)/2;
		if(mid*mid>=x) r = mid-1,res = mid;
		else l = mid+1;
	}
	return res;
}
signed main()
{
	freopen("tree.in","r",stdin);
	freopen("tree.out","w",stdout);
	ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	int T;cin>>T;
	while(T--)
	{
		int x,ans;
		cin>>x;
		if(x==0)
		{
			cout<<"2\n";
			continue;
		}
		int res = sq(x);
		ans = 2*res;
		if(res*res==x||x%2==1||res*res-res<x) ans++;
		cout<<ans<<'\n';
	}
	return 0;
}
/*
831168900
57661

457831609
42795

(x-0.5)^2=x^2-x+0.25
*/
